package com.khalil.kkadmin.ai.rag.knowledgeset;

import com.khalil.kkadmin.ai.rag.knowledgeset.entity.RagKnowledgeText;
import com.khalil.kkadmin.ai.rag.knowledgeset.service.RagKnowledgeTextService;
import com.khalil.kkadmin.common.web.ReqBody;
import com.khalil.kkadmin.common.web.RespResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/rag/knowledgeText")
public class RagKnowledgeTextController {

    @Autowired
    private RagKnowledgeTextService ragDocumentTextService;

    @PostMapping("/list")
    public RespResult<List<RagKnowledgeText>> list(@RequestBody ReqBody<String> reqBody) {
        String params = reqBody.getData();
        List<RagKnowledgeText> list = ragDocumentTextService.list(params);
        return RespResult.ok(list);
    }

}
